import gevent
import datetime
from gevent.hub import Waiter

result = Waiter()
timer = gevent.get_hub().loop.timer(1)
print(str(datetime.datetime.now()))
timer.start(result.switch, 'hi from Waiter')
print(str(datetime.datetime.now()))
gevent.sleep(2)
print(str(datetime.datetime.now()))
print(result.get())
print(str(datetime.datetime.now()))
